import 'package:flutter/material.dart';
import 'package:net/navigator/hi_navigator.dart';
import 'package:net/provider/theme_provider.dart';
import 'package:provider/provider.dart';

class DarkModelItem extends StatelessWidget {
  const DarkModelItem({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    var themeProvider = context.watch<ThemeProvider>();

    var icon = themeProvider.isDark()
        ? Icons.nightlight_round
        : Icons.wb_sunny_rounded;

    return InkWell(
      onTap: () {
        HiNavigator.geInstance().onJumpTo(RouteStatus.darkModePage);
      },
      child: Container(
        padding: EdgeInsets.only(top: 20, left: 15, bottom: 15),
        margin: EdgeInsets.only(top: 10),
        child: Row(
          children: [
            Text(
              '夜间模式',
              style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
            ),
            Padding(
              padding: EdgeInsets.only(top: 2, left: 10),
              child: Icon(icon),
            )
          ],
        ),
      ),
    );
  }
}
